package com.leruan.aasimp.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import com.leruan.aasimp.bean.CarBasicCarTypeBean;
import com.leruan.aasimp.bean.CarBasicDemioTypesBean;
import com.leruan.aasimp.dao.CarBasicInfoDao;
import com.leruan.aasimp.dao.CarBasicInfoLogDao;
import com.leruan.aasimp.dao.CarDemioInfoDao;
import com.leruan.aasimp.entity.CarBasicInfo;
import com.leruan.aasimp.entity.CarBasicInfoLog;
import com.leruan.aasimp.entity.CarDemioInfo;
import com.leruan.aasimp.service.BasicCarService;

public class BasicCarServiceImpl implements BasicCarService {

	@Resource
	private CarBasicInfoDao carBasicInfoDao;
	@Resource
	private CarBasicInfoLogDao carBasicInfoLogDao;
	@Resource
	private CarDemioInfoDao carDemioInfoDao;

	public void save(CarBasicInfo cardBasicInfo) throws Exception {

		carBasicInfoDao.save(cardBasicInfo);
	}

	public List<String> getBrandList() throws Exception {

		return carBasicInfoDao.getBrandList();
	}

	public CarBasicInfo getCarBasicInfoById(String id) throws Exception {
		return carBasicInfoDao.getCarBasicInfoById(id);
	}

	public List<String> getDepartmentListByBrand(String brand) throws Exception {
		return carBasicInfoDao.getDepartmentListByBrand(brand);
	}

	public List<String> getCarTypeListByDepartment(String department)
			throws Exception {
		return carBasicInfoDao.getCarTypeListByDepartment(department);
	}

	public List<CarBasicInfoLog> findAllLog() throws Exception {
		return carBasicInfoLogDao.findAllLog();
	}

	public List<CarBasicDemioTypesBean> getDemioTypesList() throws Exception {
		return carBasicInfoDao.getDemioTypesList();
	}

	public List<CarDemioInfo> findDemioList(Map<String, String> map)
			throws Exception {
		return carDemioInfoDao.findDemioList(map);
	}

	public List<CarBasicCarTypeBean> getCarTypes(String demioType, String carType)
			throws Exception {
		return carBasicInfoDao.getCarTypes(demioType, carType);
	}

	public CarDemioInfo getCarDemioInfo(String demioType) throws Exception {
		return carDemioInfoDao.getCarDemioInfo(demioType);
	}

	public List<CarDemioInfo> getCarDemioInfoList(String demioTypes)
			throws Exception {
		return carDemioInfoDao.getCarDemioInfoList(demioTypes);
	}

	public List<String> getImagesUrlById(String id) throws Exception {
		return carBasicInfoDao.getImagesUrlById(id);
	}
	
	public void setCarBasicInfoDao(CarBasicInfoDao carBasicInfoDao) {
		this.carBasicInfoDao = carBasicInfoDao;
	}

	public void setCarBasicInfoLogDao(CarBasicInfoLogDao carBasicInfoLogDao) {
		this.carBasicInfoLogDao = carBasicInfoLogDao;
	}

	public void setCarDemioInfoDao(CarDemioInfoDao carDemioInfoDao) {
		this.carDemioInfoDao = carDemioInfoDao;
	}

	public Long getCarBasicId(String brand, String department, String carType)
			throws Exception {
		return carBasicInfoDao.getCarBasicId(brand, department, carType);
	}

}
